import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

const store = new Vuex.Store({
	
	state: {
		year : uni.getStorageSync('year') || '2022',
		rangeYears: uni.getStorageSync('rangeYears') || [],
	},
	
	mutations: {
		updateYear(state, value) {
			uni.setStorageSync('year', value);
			state.year = value
		},
		
		lastestYear(state, value) {
			uni.setStorageSync('rangeYears', value);
			state.rangeYears = value
		}
	},
	actions: {

	},
	getters: {
	
	}
})

export default store
